let UserInfoApp = new Vue({
    el:"#userInfoApp",
    data:{
        userInfoVO:{},
        message:''
    },
    methods:{
        loadMyInfo(){
            axios.get('/portal/user/myInfo')
                .then(result=>{
                    let r = result.data
                    console.log(r)
                    if(r.code == OK){
                        this.userInfoVO = r.data
                        this.userInfoVO.birthday = this.userInfoVO.birthday.split("T")[0]
                        $("#selfIntroduction").val(this.userInfoVO.selfIntroduction)
                    }
                })
        },
        updateMyInfo(){
            let data = {
                nickname : this.userInfoVO.nickname,
                sex : this.userInfoVO.sex,
                birthday : this.userInfoVO.birthday,
                selfIntroduction : $("#selfIntroduction").val()
            }
            axios.post('/portal/user/updateInfo',data)
                .then(result=>{
                    let r = result.data
                    this.message = r.message
                })
        }
    },
    created(){
        this.loadMyInfo()
    }
})